//
// Created by lenovo on 25-5-8.
//
#include "iostream"
using namespace std;
class A
{
public:
    int a = 10;
protected:
    int b = 20;
private:
    int c = 30;
};

class C : public A
{
public:
    void funC()
    {
        cout<<a<<endl;
        cout<<b<<endl;
        //cout<<c<<endl; 父类中的私有权限，子类访问不到
    }
};
class D : protected A
{
public:
    void funC()
    {
        cout<<a<<endl;//父类公共，保护继承后变为protected
        cout<<b<<endl;//父类保护，子类依然是保护 保护权限仅能在类内访问
        //cout<<c<<endl; 父类中的私有权限，子类访问不到
    }
};
class E : private A
{
public:
    void funC()
    {
        cout<<a<<endl;//父类公共，子类变为私有
        cout<<b<<endl;//父类保护，子类变为私有
        //cout<<c<<endl; 父类中的私有权限，子类访问不到
    }
};
void Test01()
{
    C c;
    cout<<c.a <<endl;
}
void Test02()
{
    D d;
    cout<<d.a <<endl;
}
void Test03()
{
    E e;
    cout<<e.a <<endl;
}
class E_Son : public E
{
public:
    void func()
    {
        a = 100;
    }
};
int main()
{
    Test01();
    return 0;
}